/*!
 * 业务流程授权 通用（请求）方法
 *  
 * 作者：张莉
 * Copyright (c) 2019/12/11
 * 
 */

/**
 * @method workflowProcessBusiness 获取业务流程授权列表
 * @param {number} page 业务流程列表当前显示的页数
 * @param {number} pageSize 业务流程列表一页有多少条数据
 * @param {object} params 存放模糊搜索内容、高级查询的form对象
 * @return axios
 */
export const workflowProcessBusiness = (page, pageSize, params) => {
  return axios.post(`/workflow/config/processBusiness/findList/${page}/${pageSize}`, params)
}
/**
 * @method workflowGetProcessTree 获取添加流程树形结构数据
 * @return axios
 */
export const workflowGetProcessTree = () => {
  return axios.get('/workflow/config/getProcessTree')
}
/**
 * @method workflowGetProcessCatalog 查询流程树下的目录
 * @param {string} id 存放目录parentCatalogId
 * @return axios
 */
export const workflowGetProcessCatalog = (id) => {
  return axios.get('/workflow/config/getProcessTree?parentCatalogId=' + id)
}
/**
 * @method workflowGetProcessProcess 查询流程树下的流程
 * @param {string} id 存放流程活动pprocessId
 * @return axios
 */
export const workflowGetProcessProcess = (id) => {
  return axios.get('/workflow/config/getProcessTree?processId=' + id)
}
/**
 * @method workflowProcessBusinessDelete 删除业务与流程授权
 * @param {string} id 业务与流程表格当前行mapId
 * @return axios
 */
export const workflowProcessBusinessDelete = (id) => {
  return axios.delete(`/workflow/config/processBusiness/${id}`)
}
/**
 * @method workflowProcessBusinessAdd 新增业务与流程授权
 * @param {object} params 存放业务与流程授权新增弹框里的form对象
 * @return axios
 */
export const workflowProcessBusinessAdd = (params) => {
  return axios.post('/workflow/config/processBusiness', params)
}
/**
 * @method workflowProcessBusinessEdit 更新业务与流程授权
 * @param {object} params 存放业务与流程授权编辑弹框里的form对象
 * @return axios
 */
export const workflowProcessBusinessEdit = (params) => {
  return axios.put('/workflow/config/processBusiness', params)
}
/**
 * @method workflowProcessBusinessDetails 根据授权ID查询业务与流程授权的详情信息
 * @param {string} id 业务与流程表格当前行mapId
 * @return axios
 */
export const workflowProcessBusinessDetails = (id) => {
  return axios.get(`/workflow/config/processBusiness/${id}`)
}